//基于原生 nodejs api 使用 webpack-dev-server
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const WebpackConfig = require("./webpack.config.js");
const compiler = webpack(WebpackConfig);
const devServerOptions = { ...WebpackConfig.devServer, open: true };
const server = new WebpackDevServer(devServerOptions, compiler);
server.startCallback(()=>{
    console.log(`starting server on http://localhost:${devServerOptions.port}`)
});